package com.bingbing.back.controller;

import com.bingbing.back.dto.SchoolAdmScoreDto;
import com.bingbing.back.po.SchoolAdmScore;
import com.bingbing.back.service.SchoolAdmScoreService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/admScore")
public class SchoolAdmScoreController {
    @Resource
    private SchoolAdmScoreService schoolAdmScoreService;

    /**
     * 根据年份返回该年份下的所有录取批次类型
     * @param admYear 查询年份
     */
    @RequestMapping("/batch")
    List<String> searchAdmScoreBatchByYear(int admYear){
        return schoolAdmScoreService.searchAdmScoreBatchByYear(admYear);
    }

    /**
     * 获取学校的省分数线
     * @param schoolAdmScore 必须要有schoolId，可有admYear，admSchoolBatch，admType
     *                              学校id        录取年份，录取批次，招生类型
     * @return
     */
    @RequestMapping("/searchAdmScore")
    public List<SchoolAdmScoreDto> searchAdmScore(SchoolAdmScore schoolAdmScore) {
        return schoolAdmScoreService.searchAdmScore(schoolAdmScore);
    }
}
